package com.lagou.niancheng.mvc.biz.controller;

import com.lagou.niancheng.mvc.biz.service.ResourceService;
import com.lagou.niancheng.mvc.dispatcher.annotations.MyAutowired;
import com.lagou.niancheng.mvc.dispatcher.annotations.MyController;
import com.lagou.niancheng.mvc.dispatcher.annotations.MyRequestMapping;
import com.lagou.niancheng.mvc.dispatcher.annotations.MySecure;

/**
 * 资源请求处理
 *
 * @description: default
 * @author: 阿秋@niancheng
 * @date: 2020/4/8
 */
@MyController
@MyRequestMapping("/access")
public class ResourceController {
    @MyAutowired("ResourceService")
    private ResourceService resourceService;

    @MyRequestMapping("/resource1")
    @MySecure(username = "zhangsan")
    public String resource1() {
        return resourceService.resource1();
    }

    @MyRequestMapping("/resource2")
    @MySecure(username = "lisi")
    public String resource2() {
        return resourceService.resource2();
    }

    @MyRequestMapping("/resource3")
    @MySecure(username = {"lisi", "zhangsan"})
    public String resource3() {
        return resourceService.resource3();
    }

}
